﻿using System;
using System.Data;
using System.Web.UI.WebControls;

public partial class TopDetay : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {        
        ceTerm dm = new ceTerm();

        if (Request.QueryString["TopId"] != null)
        {
            int RollId = int.Parse(Request.QueryString["TopId"]);
            lblDetay.Text = /*RollId.ToString() + " no.lu top detayı<p>*/"<small>";
            DataSet ds = dm.GetTopDetay(RollId, 0);

            foreach (DataColumn dc in ds.Tables[0].Columns)
                lblDetay.Text += "<b>"+dc.ColumnName + ":</b> " + (ds.Tables[0].Rows[0][dc.ColumnName] != DBNull.Value ? ds.Tables[0].Rows[0][dc.ColumnName].ToString() : string.Empty) + "<br>";
            
            img.ImageUrl = "Photo.aspx?TopId=" + RollId.ToString();
            lblZoom.Text = "<A href=PhotoLarge.aspx?TopId=" + RollId.ToString() + ">zoom</A>";
            
            //Image1 = ds.Tables[3].Rows[0]["PhotoLarge"] as Image;
        }

        if (Request.QueryString["BufferTempId"] != null)
        {
            int BufferTempId= int.Parse(Request.QueryString["BufferTempId"]);            
            DataTable dt = dm.GetBuffer(BufferTempId);

            lblDetay.Text = "<small><ol>";
            foreach (DataRow dr in dt.Rows)
                lblDetay.Text += "<li><A href=TopDetay.aspx?TopId=" + dr["RollId"].ToString() + ">" + dr["RollId"].ToString() + "</A>";
            lblDetay.Text += "</ol>";
        }
    }
}
